package com.hulu.yec.qes.servlet;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hulu.yec.common.util.FastjsonUtil;
import com.hulu.yec.qes.service.QesExamPaperService;

/**
 * Servlet implementation class QesExamPaperServlet
 */
@WebServlet("/qes/QesExamPaperServlet")
public class QesExamPaperServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
//		        // 查询试卷表中所有的数据
//		QesExamPaperService qesExamPaperService = new QesExamPaperService();
//		        String id = request.getParameter("id");
//				Map<String,Object> paper= qesExamPaperService.getExamInfos(id);
//				request.setAttribute("paper", paper);
//				
//				////根据试卷信息查询对应试卷题目
//				
//				///获取选择题
//				List<Map<String,Object>> choiceList = qesExamPaperService.getSubjectByQuestionTypeId("1", paper.get("single_option_number")+"");
//				
//				// 获取多选题信息
//				List<Map<String,Object>> multipleList = qesExamPaperService.getSubjectByQuestionTypeId("2", paper.get("multi_option_number")+"");
//				
//				// 获取判断题信息
//				List<Map<String,Object>> judgeList = qesExamPaperService.getSubjectByQuestionTypeId("3", paper.get("judge_number")+"");
//				
//				// 把所有试题存储在request对象中
//				request.setAttribute("choiceList", choiceList);
//				request.setAttribute("multipleList", multipleList);
//				request.setAttribute("judgeList", judgeList);
//				//生成Json
//				
//				
//				
//				
//				request.getRequestDispatcher("/WEB-INF/view/stu/paper.jsp").forward(request, response);
//    }
	}
}